Skip to content

fix(desktop): replace titleBarOverlay with custom caption buttons for RTL support#35387

Open
IlayBacil1999 wants to merge 1 commit into
anomalyco:devfrom
IlayBacil1999:fix/rtl-caption-buttons
Open

fix(desktop): replace titleBarOverlay with custom caption buttons for RTL support#35387
IlayBacil1999 wants to merge 1 commit into
anomalyco:devfrom
IlayBacil1999:fix/rtl-caption-buttons

Conversation

@IlayBacil1999

@IlayBacil1999 IlayBacil1999 commented Jul 5, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #35388

Type of change

  • Bug fix

What does this PR do?

On RTL-configured Windows systems, Electron's titleBarOverlay places the minimize/maximize/close buttons on the left side of the titlebar, colliding with opencode's own buttons (menu, sidebar toggle, navigation).

This removes titleBarOverlay and replaces it with custom renderer-side caption buttons that sit in the right-side spacer already reserved for them. The buttons use native Windows 11-style hover effects (grey overlay on minimize/maximize, red on close).

How did you verify your code works?

Tested locally with electron-vite dev on Windows 11. The titlebar renders correctly with 3 caption buttons on the right that respond to hover/click and properly minimize/maximize/close the window.

Screenshots / recordings

issue:
image

solved:
image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Replaces the OS-rendered titleBarOverlay caption buttons with custom
app-rendered buttons that stay on the right side regardless of Windows
RTL settings. This fixes the collision between the close/minimize/restore
buttons and the opencode titlebar buttons on RTL systems.

- Remove titleBarOverlay from window creation (frame: false, hidden titlebar kept)
- Add custom minimize/maximize/close buttons in the renderer titlebar
- Wire IPC handlers and preload API for window controls
- Track maximize state via event forwarding
- Remove hardcoded 138px right spacer and titlebar-area-width constraints
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RTL Windows: minimize/maximize/close buttons collide with opencode titlebar buttons

1 participant